<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>100课堂会员中心</title>
<link rel="shortcut icon" href="favicon.ico" />
<link href="user/css/UserCenter.css?v=<?=WEB_VERSION?>" rel="stylesheet" type="text/css" />
<script src="user/js/jquery-1.7.1.min.js?v=<?=WEB_VERSION?>" type="text/javascript" language="javascript"></script>
<script src="user/js/UserWin.min.js?v=<?=WEB_VERSION?>" type="text/javascript" language="javascript"></script>
</head>
<script>
function download_file(url){
	window.location.href=url
	window.location.target="_blank";
}
</script>
<body>
<?include('userTop.php')?>
<div class="CenterAuto">
	<?
    include('userLeft.php')
    ?>
     <div class="CenterRight">
		<?
	    include('userMenu.php')
	    ?>
    <p style=" text-indent:2em; color:#666; padding:0 0 10px 0;">温馨提示：如若取消课程，请提前1小时联系我们，谢谢！</p>
    <table width="770" border="0" cellspacing="2">
      <tr>
        <td height="30" align="center" valign="middle" bgcolor="#0D6DB7" class="ColorFFF">时间</td>
        <td height="30" align="center" valign="middle" bgcolor="#0D6DB7" class="ColorFFF">卡类型</td>
        <td height="30" align="center" valign="middle" bgcolor="#0D6DB7" class="ColorFFF">已约外教</td>
        <td height="30" align="center" valign="middle" bgcolor="#0D6DB7" class="ColorFFF">课程教材</td>
        <td height="30" align="center" valign="middle" bgcolor="#0D6DB7" class="ColorFFF">操作</td>
      </tr>
		<?
		foreach($list as $v){
		?>      
   		<tr>
        <td height="160" align="center" valign="middle" bgcolor="#E7E7E7"><p><?=date('Y-m-d',$v['book_date'])?></p><p><?=$v['book_time_name']?></p></td>
        <td height="160" align="center" valign="middle" bgcolor="#E7E7E7"><?=$v['book_type']?></td>
        <td height="160" align="center" valign="middle" bgcolor="#E7E7E7">
        	<p>
        	<br>
        	<a href="<?=SITE_URL?>teacher/info_<?=$v['teacher_id']?>.htm"><img src="<?=SITE_URL.$v['teacher_portrait']?>" width="80" height="105" /></a></p>
            <p><a href="#"><?=$v['teacher']?></a></p>
            <p>QQ:<?=$v['teacher_qq']?></p>
            <p>Skype:<?=$v['teacher_skype']?></p>
        </td>
        <td height="160" align="center" valign="middle" bgcolor="#E7E7E7">
        	<p id="li_course_<?=$v['id']?>"><?=$v['course'].'-'.$v['chapter_name']?></p>
            <p>&nbsp;</p>
            <?if($v['course_type']!=COURSE_TYPE_18){?>
            <p><a class="PublicButtonStyle" href="javaScript:void(0);"  onClick="javaScript:download_file('<?=$v['download_url']?>')">下载教材</a>
            <?}?>
              <?if($v['class_status']==CLASS_STATUS_0){?>
              <a class="PublicButtonStyle" href="javaScript:void(0);"  name="edit_teaching_material" id2="<?=$v['id']?>">修改教材</a>
              <?}?>
            </p>
        </td>
        <td height="160" align="center" valign="middle" bgcolor="#E7E7E7">
            <p>
		     	<?if($v['cancellation']!=5){?>
    			   <a href="user_cancellation.htm?id=<?=$v['id']?>">
			        		取消预约
			       </a>
		        <?}{if($v['class_status']!=CLASS_STATUS_2){?>
		            <?$today = strtotime(date('Y-m-d'));
		              $now_time=date('H').date('i');
		            	if($today<$v['book_date']){?>
       						<a href="user_cancellation.htm?id=<?=$v['id']?>">
			        		取消预约
			        		</a>
		        	<?}?>
		            <?if($today==$v['book_date']){?>
		            		<?if($now_time+100<=$v['book_time']){?>
			        		<a href="user_cancellation.htm?id=<?=$v['id']?>">
			        		取消预约
			        		</a>
		        	      <?}elseif($now_time<$v['book_time']&&$now_time+100>$v['book_time']){?>
		        			准备上课
		        		  <?}elseif($now_time>$v['book_time']+30){?>
		        			未上课
		        		  <?}elseif($now_time>=$v['book_time']&&$now_time<=$v['book_time']+30){?>
		        			课堂时间
		        		  <?}?>
		        	<?}?>
		        <?}else{?>
		        	已完成上课
		        <?}}?>            
            </p>
        </td>
      </tr>
      <?
		}
	  ?>     
     </table>
	</div>
  <div class="clearc"></div>
</div>
<script>
$("a[name='edit_teaching_material']").click(function(){
	var id=$(this).attr("id2");
	var s = window.showModalDialog("user_updateBooking.htm?id="+id,window,"dialogWidth=650px;dialogHeight=600px");
	if(s.length>0){
		$("#li_course_"+id).html(s);
	}
})					
</script>	
<?include('userFoot.php')?>	   
</body>
</html>
